﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Advantage.Data.Provider;
using Advantage.Data;

namespace KitBuildingWF.DataAccess
{
    public abstract class GenericNativeDAO<T>
    {

        //public AdsDataReader GeneralSQLQuery(String statement)
        //{
        //    AdsDataReader returnReader;
       // }
        string connString = DataAccess.ADSAccess.GetDevCropConnectionString();
        AdsConnection conn;
        AdsCommand cmd;


        public GenericNativeDAO(){
            // initialize connection
            conn = new AdsConnection(connString);
        }

        public AdsConnection GetConnection()
        {
            return conn;
        }

        public AdsCommand GetCommand()
        {
             
            // make the connection to the server 
            conn.Open();

            // create a command object 
            cmd = conn.CreateCommand();

            return cmd;
        }

        public void closeConnection(){
            conn.Close();
        }

    }
}
